//
//  CNavigationController.m
//  CarLife
//
//  Created by yu on 2019/3/28.
//  Copyright © 2019年 jpas. All rights reserved.
//

#import "CNavigationController.h"
#import "UIBarButtonItem+CLItem.h"
@interface CNavigationController ()

@end

@implementation CNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if(self.childViewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithImage:[UIImage imageNamed:@"back_gray"] target:self action:@selector(returnAction) forControlEvents:UIControlEventTouchUpInside];
    }
    [super pushViewController:viewController animated:animated];
}

#pragma mark - 返回
- (void)returnAction {
    [self popViewControllerAnimated:YES];
}

@end
